smalltalk.addPackage('Easnoth-Tests', {});
smalltalk.addClass('EasnothArrayTest', smalltalk.TestCase, ['imageArray'], 'Easnoth-Tests');
smalltalk.addMethod(
"_testAtIndex",
smalltalk.method({
selector: "testAtIndex",
fn: function () {
    var self = this;
    self['@imageArray'] = [["1-1", "1-2", "1-3", "1-4"], ["2-1", "2-2"]];
    smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(self['@imageArray'], "_atIndex_", [[1, 1]]), "__eq", ["1-1"])]);
    smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(self['@imageArray'], "_atIndex_", [[2, 2]]), "__eq", ["2-2"])]);
    return self;
}
}),
smalltalk.EasnothArrayTest);

smalltalk.addMethod(
"_testAtIndexPut",
smalltalk.method({
selector: "testAtIndexPut",
fn: function () {
    var self = this;
    self['@imageArray'] = [["1-1", "1-2", "1-3", "1-4"], ["2-1", "2-2"]];
    smalltalk.send(self['@imageArray'], "_atIndex_put_", [[1, 3], "smth"]);
    smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(self['@imageArray'], "_atIndex_", [[1, 3]]), "__eq", ["smth"])]);
    return self;
}
}),
smalltalk.EasnothArrayTest);

smalltalk.addMethod(
"_testAtLibrary",
smalltalk.method({
selector: "testAtLibrary",
fn: function () {
    var self = this;
    self['@imageArray'] = [["1-1", "1-2", "1-3", "1-4"], ["2-1", "2-2"]];
    smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(self['@imageArray'], "_atLibrary_", [1]), "__eq", [["1-1", "1-2", "1-3", "1-4"]])]);
    return self;
}
}),
smalltalk.EasnothArrayTest);

smalltalk.addMethod(
"_testLoadingLibrary",
smalltalk.method({
selector: "testLoadingLibrary",
fn: function () {
    var self = this;
    var lib = nil;
    var dict = nil;
    self['@imageArray'] = smalltalk.send(smalltalk.Array || Array, "_new_", [1]);
    dict = ["dirt.png", "grass.png", "road.png", "savanna.png"];
    lib = function ($rec) {smalltalk.send($rec, "_index_", [1]);smalltalk.send($rec, "_path_", ["ressources/images/tiles/"]);smalltalk.send($rec, "_srcArray_", [dict]);return smalltalk.send($rec, "_onload_", [function () {(function ($rec) {smalltalk.send($rec, "_cr", []);return smalltalk.send($rec, "_show_", [smalltalk.send(smalltalk.send(self['@imageArray'], "_atIndex_", [[1, 1]]), "_src", [])]);}(smalltalk.Transcript || Transcript));smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.send(self['@imageArray'], "_atIndex_", [[1, 1]]), "_src", []), "__eq", ["http://localhost:4000/projects/easnoth/ressources/images/tiles/dirt.png"])]);return smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.send(self['@imageArray'], "_atIndex_", [[1, 3]]), "_src", []), "__eq", ["http://localhost:4000/projects/easnoth/ressources/images/tiles/road.png"])]);}]);}(smalltalk.send(smalltalk.LibraryInfos || LibraryInfos, "_new", []));
    smalltalk.send(self['@imageArray'], "_loadLibrary_", [lib]);
    return self;
}
}),
smalltalk.EasnothArrayTest);



smalltalk.addClass('EasnothTest', smalltalk.TestCase, [], 'Easnoth-Tests');
smalltalk.addMethod(
"_emulateRessourceTest_",
smalltalk.method({
selector: "emulateRessourceTest:",
fn: function (aTest) {
    var self = this;
    var image = nil;
    var arr = nil;
    image = new Image;
    arr = smalltalk.send(smalltalk.Array || Array, "_new_", [1]);
    smalltalk.send(arr, "_at_put_", [1, image]);
    smalltalk.send(image, "_at_put_", ["onload", function () {smalltalk.send(smalltalk.Tile || Tile, "_arrayImg_", [arr]);return smalltalk.send(aTest, "_value", []);}]);
    smalltalk.send(image, "_at_put_", ["src", "specter.png"]);
    return self;
}
}),
smalltalk.EasnothTest);

smalltalk.addMethod(
"_testBug",
smalltalk.method({
selector: "testBug",
fn: function () {
    var self = this;
    smalltalk.send(self, "_assert_", [true]);
    return self;
}
}),
smalltalk.EasnothTest);



smalltalk.addClass('CellTest', smalltalk.EasnothTest, [], 'Easnoth-Tests');
smalltalk.addMethod(
"_testNew",
smalltalk.method({
selector: "testNew",
fn: function () {
    var self = this;
    var cell = nil;
    var cellArray = nil;
    var coods = nil;
    smalltalk.send(self, "_emulateRessourceTest_", [function () {cellArray = [[1, 1], [1, 1]];coods = [5, 12];cell = smalltalk.send(smalltalk.Cell || Cell, "_newWithContext_cellArray_coods_", ["aCtx", cellArray, coods]);smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(cell, "_x", []), "__eq", [5])]);smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(cell, "_y", []), "__eq", [12])]);return smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.send(cell, "_tile", []), "_class", []), "__eq", [smalltalk.Tile || Tile])]);}]);
    return self;
}
}),
smalltalk.CellTest);



smalltalk.addClass('MapTest', smalltalk.EasnothTest, [], 'Easnoth-Tests');
smalltalk.addMethod(
"_testNew",
smalltalk.method({
selector: "testNew",
fn: function () {
    var self = this;
    var map = nil;
    map = smalltalk.send(smalltalk.Map || Map, "_new", []);
    smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.send(map, "_canvas", []), "_class", []), "__eq", [smalltalk.TagBrush || TagBrush])]);
    return self;
}
}),
smalltalk.MapTest);

smalltalk.addMethod(
"_testNewWithMapArray",
smalltalk.method({
selector: "testNewWithMapArray",
fn: function () {
    var self = this;
    var map = nil;
    var cell = nil;
    smalltalk.send(self, "_emulateRessourceTest_", [function () {map = smalltalk.send(smalltalk.Map || Map, "_newWithMapArray_", [[[[[1, 1]]]]]);smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(map, "_width", []), "__eq", [1])]);smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(map, "_height", []), "__eq", [1])]);smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(map, "_mapX", []), "__eq", [98.5])]);smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(map, "_mapY", []), "__eq", [40])]);smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.send(map, "_cells", []), "_size", []), "__eq", [1])]);smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(map, "_cells", []), "_at_", [1]), "_size", []), "__eq", [1])]);cell = smalltalk.send(smalltalk.send(smalltalk.send(map, "_cells", []), "_at_", [1]), "_at_", [1]);smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(cell, "_class", []), "__eq", [smalltalk.Cell || Cell])]);return smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.send(cell, "_tile", []), "_class", []), "__eq", [smalltalk.Tile || Tile])]);}]);
    return self;
}
}),
smalltalk.MapTest);



smalltalk.addClass('TileTest', smalltalk.EasnothTest, [], 'Easnoth-Tests');
smalltalk.addMethod(
"_testNew",
smalltalk.method({
selector: "testNew",
fn: function () {
    var self = this;
    var tile = nil;
    smalltalk.send(self, "_emulateRessourceTest_", [function () {tile = smalltalk.send(smalltalk.Tile || Tile, "_newWithContext_index_", ["aCtx", [1, 1]]);smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(tile, "_context", []), "__eq", ["aCtx"])]);return smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(tile, "_isWall", []), "__eq", [false])]);}]);
    return self;
}
}),
smalltalk.TileTest);



smalltalk.addClass('WorldTest', smalltalk.EasnothTest, ['world'], 'Easnoth-Tests');
smalltalk.addMethod(
"_testDisplay",
smalltalk.method({
selector: "testDisplay",
fn: function () {
    var self = this;
    var image = nil;
    var arr = nil;
    image = new Image;
    arr = smalltalk.send(smalltalk.Array || Array, "_new_", [1]);
    smalltalk.send(arr, "_at_put_", [1, smalltalk.send(smalltalk.Array || Array, "_new_", [1])]);
    smalltalk.send(arr, "_atIndex_put_", [[1, 1], image]);
    smalltalk.send(image, "_at_put_", ["onload", function () {self['@world'] = smalltalk.send(smalltalk.World || World, "_newMapEditorWorldWithLibrairies_map_", [[[1, 2, 3, 4], [1, 2, 3, 4]], 1]);smalltalk.send(smalltalk.Tile || Tile, "_arrayImg_", [arr]);return smalltalk.send(self['@world'], "_startGame", []);}]);
    smalltalk.send(image, "_at_put_", ["src", "specter.png"]);
    smalltalk.send(self, "_assert_", [true]);
    return self;
}
}),
smalltalk.WorldTest);

smalltalk.addMethod(
"_testNew",
smalltalk.method({
selector: "testNew",
fn: function () {
    var self = this;
    smalltalk.send(self, "_emulateRessourceTest_", [function () {self['@world'] = smalltalk.send(smalltalk.World || World, "_newMapEditorWorldWithLibrairies_map_", [[[1, 3, 5], [1, 2, 6]], 1]);smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.send(self['@world'], "_map", []), "_class", []), "__eq", [smalltalk.Map || Map])]);smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.send(self['@world'], "_resource", []), "_class", []), "__eq", [smalltalk.Resource || Resource])]);return smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.send(self['@world'], "_eventManager", []), "_class", []), "__eq", [smalltalk.MapEditorEventManager || MapEditorEventManager])]);}]);
    return self;
}
}),
smalltalk.WorldTest);



smalltalk.addClass('LibraryInfosTest', smalltalk.TestCase, ['imageArray'], 'Easnoth-Tests');
smalltalk.addMethod(
"_testLoad",
smalltalk.method({
selector: "testLoad",
fn: function () {
    var self = this;
    var array = nil;
    var libInfo = nil;
    array = smalltalk.send(smalltalk.Array || Array, "_new_", [1]);
    (function ($rec) {smalltalk.send($rec, "_index_", [1]);smalltalk.send($rec, "_path_", ["ressources/images/tiles/"]);smalltalk.send($rec, "_srcArray_", [["road.png", "dirt.png"]]);smalltalk.send($rec, "_onload_", [function () {(function ($rec) {smalltalk.send($rec, "_cr", []);return smalltalk.send($rec, "_show_", [smalltalk.send("array : ", "__comma", [array])]);}(smalltalk.Transcript || Transcript));smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.send(array, "_atIndex_", [[1, 1]]), "_src", []), "__eq", ["http://localhost:4000/projects/easnoth/ressources/images/tiles/road.png"])]);return smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.send(array, "_atIndex_", [[1, 2]]), "_src", []), "__eq", ["http://localhost:4000/projects/easnoth/ressources/images/tiles/dirt.png"])]);}]);return smalltalk.send($rec, "_load_", [array]);}(smalltalk.send(smalltalk.LibraryInfos || LibraryInfos, "_new", [])));
    return self;
}
}),
smalltalk.LibraryInfosTest);



smalltalk.addClass('Resourcetest', smalltalk.TestCase, [], 'Easnoth-Tests');
smalltalk.addMethod(
"_testNew",
smalltalk.method({
selector: "testNew",
fn: function () {
    var self = this;
    var res = nil;
    res = smalltalk.send(smalltalk.Resource || Resource, "_new", []);
    smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.Tile || Tile, "_arrayImg", []), "__eq", [smalltalk.send(res, "_tileImg", [])])]);
    smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.send(res, "_tileImg", []), "_class", []), "__eq", [smalltalk.Array || Array])]);
    return self;
}
}),
smalltalk.Resourcetest);

smalltalk.addMethod(
"_testNewWith",
smalltalk.method({
selector: "testNewWith",
fn: function () {
    var self = this;
    var res = nil;
    res = smalltalk.send(smalltalk.Resource || Resource, "_newWithLibrairies_map_world_", [[[1], [1]], 1, function ($rec) {smalltalk.send($rec, "_loaded_", [0]);return smalltalk.send($rec, "_totalToLoad_", [2]);}(smalltalk.send(smalltalk.World || World, "_new", []))]);
    smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(res, "_tileImg", []), "_atIndex_", [[1, 1]]), "_src", []), "__eq", ["http://localhost:4000/projects/easnoth/ressources/images/tiles/road.png"])]);
    return self;
}
}),
smalltalk.Resourcetest);



smalltalk.addClass('XMLHttpRequestProxyTest', smalltalk.TestCase, [], 'Easnoth-Tests');
smalltalk.addMethod(
"_testLoad",
smalltalk.method({
selector: "testLoad",
fn: function () {
    var self = this;
    var xmlProxy = nil;
    var xmlDoc = nil;
    xmlProxy = smalltalk.send(smalltalk.XMLhttpRequestProxy || XMLhttpRequestProxy, "_new", []);
    xmlDoc = smalltalk.send(xmlProxy, "_loadXML_", ["ressources/xml/maps/map1.xml"]);
    smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(xmlDoc, "_class", []), "__eq", [smalltalk.JSObjectProxy || JSObjectProxy])]);
    return self;
}
}),
smalltalk.XMLHttpRequestProxyTest);



